home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 15257 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  957 b 

  1. Path: nntp.teleport.com!usenet
  2. From: GHouck <hksys@teleport.com>
  3. Newsgroups: comp.lang.c
  4. Subject: Re: NT  CGI script
  5. Date: 18 Apr 1996 07:18:00 GMT
  6. Organization: systems hk
  7. Message-ID: <4l4qb8$r1v@nadine.teleport.com>
  8. References: <3172E7F9.3D39@joseph.dswnet.com>
  9. NNTP-Posting-Host: ip-pdx07-11.teleport.com
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; I; 32bit)
  14.  
  15. Joseph Altea <joseph@joseph.dswnet.com> wrote:
  16. >I have the desire to read from stdin under NT (Symantec 7.2) C compiler.
  17. >I need to read stdin as a BINARY, NT seems to think stdin is always TEXT 
  18. >mode. 
  19. >
  20. >joseph@joseph.dswnet.com
  21.  
  22. Joseph,
  23. I don't know if your compiler has an equivalent or whether it
  24. is standard C, but the following works to put either stdin
  25. or stdou into a binary mode:
  26.  
  27.   if( fInp == stdin )
  28.     setmode( 0,O_BINARY );
  29.   if( fOut == stdout )
  30.     setmode( 1,O_BINARY );
  31.  
  32. Yours, Geoff Houck
  33.  
  34.